//
//  NetworkOperation.h
//  TicketingSystem
//
//  Created by Conner Wu on 15/7/20.
//  Copyright (c) 2015年 Beyondsoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


#define kHttpReturnCodeKey @"success"
#define kHttpReturnMsgKey  @"msg"
#define kHttpReturnResultKey  @"data"

#define kHttpReturnSuccCode 1
#define kHttpRetryCount     1


typedef NS_ENUM(NSUInteger, NetworkFlag) {
    NetworkFlagTest = 101, // for test
};

typedef NS_ENUM(NSUInteger, HttpMethod) {
    HttpMethodPost      = 1,
    HttpMethodGet       = 2,
    HttpMethodPut       = 3,
    HttpMethodDelete    = 4
};


@interface NetworkOperation : NSObject

@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) NSDictionary *params;
@property (nonatomic, strong) NSArray *files;
@property (nonatomic, strong) UIView *loadingSuperView;
@property (nonatomic, assign) BOOL showLoading;
@property (nonatomic, assign) BOOL showError;

@property (nonatomic, assign) NetworkFlag flag;
@property (nonatomic, strong) void (^completion) (id result);

- (void)sendDataByGet;
- (void)sendDataByPut;
- (void)sendDataByPost;
- (void)sendDataByDelete;


@end
